﻿using BCCommon.OAEnums.Reimbursement;
using BCEntity.OA.Reimbursement;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.OA.Reimbursement
{
    public interface IReimbursementRecordData
    {
        /// <summary>
        /// 新增一批报销信息
        /// </summary>
        /// <param name="entities">报销信息</param>
        /// <returns></returns>
        Task<bool> InsertListAsync(List<ReimbursementRecordEntity> entities);
        /// <summary>
        /// 根据申请编号获取报销记录信息
        /// </summary>
        /// <param name="applyCode">申请编号</param>
        /// <returns></returns>
        Task<ReimbursementRecordEntity> GetEntityByApplyCode(string applyCode);

        /// <summary>
        /// 新增一条报销信息
        /// </summary>
        /// <param name="entity">报销信息</param>
        /// <returns></returns>
        Task<ReimbursementRecordEntity> InsertAsync(ReimbursementRecordEntity entity);
        /// <summary>
        /// 更新指定的报销记录状态信息
        /// </summary>
        /// <param name="applyCode">申请单</param>
        /// <param name="modifierName">修改时间</param>
        /// <param name="status">状态</param>
        /// <returns></returns>
        Task<ReimbursementRecordEntity> UpdateStatus(string applyCode, long editerAdminId, string modifierName, ReimbursementApplyStatus status);
        /// <summary>
        /// 分页获取OA报销申请记录(列表)
        /// </summary>
        /// <param name="adminId">当前登录管理员</param>
        /// <param name="departmentName">部门名称</param>
        /// <param name="adminName">员工名称</param>
        /// <param name="start">申请时间开始</param>
        /// <param name="end">申请时间结束</param>
        /// <param name="ascending">是否升序排序</param>
        /// <param name="pageIndex">分页页码</param>
        /// <param name="pageSize">分页页数</param>
        /// <param name="isMyApproved"></param>
        /// <returns></returns>
        Task<(IEnumerable<ReimbursementRecordEntity>, int)> GetListAsync(long adminId, string departmentName, string adminName, DateTime? start, DateTime? end, bool? ascending, int pageIndex, int pageSize, string sortName, bool? isMyApproved, int? companyId);
    }
}
